package com.sapitest.keywords.asserts;

import com.sapitest.utils.data.XML2JSON;

/**
 * XML数据类型的断言方法
 * @date 2019-01-13
 * @author Liuxu
 * @version 1.0.0
 * @since jdk1.8
 */
public class XMLAssert {

    public static void XMLEquals(String actual, String expected){
        XML2JSON xml2JSON = new XML2JSON();
        JSONAssert.jsonObjectEquals(xml2JSON.xml2json(actual), xml2JSON.xml2json(expected));
    }

    public static void XMLNotEquals(String actual, String expected){
        XML2JSON xml2JSON = new XML2JSON();
        JSONAssert.jsonObjectNotEquals(xml2JSON.xml2json(actual), xml2JSON.xml2json(expected));
    }

    public static void XMLHasTable(String actual, String expectedTable){
        XML2JSON xml2JSON = new XML2JSON();
        JSONAssert.jsonObjectHasKey(xml2JSON.xml2json(actual), expectedTable);
    }

    public static void XMLNotHasTable(String actual, String expectedTable){
        XML2JSON xml2JSON = new XML2JSON();
        JSONAssert.jsonObjectNotHasKey(xml2JSON.xml2json(actual), expectedTable);
    }

    public static void XMLHasValue(String actual, String expectedValue){
        XML2JSON xml2JSON = new XML2JSON();
        JSONAssert.jsonObjectHasValue(xml2JSON.xml2json(actual), expectedValue);
    }

    public static void XMLNotHasValue(String actual, String expectedValue){
        XML2JSON xml2JSON = new XML2JSON();
        JSONAssert.jsonObjectNotHasValue(xml2JSON.xml2json(actual), expectedValue);
    }

}
